#include <joyos.h>
#include <happylib.h>

// my headers
#include "umain.h"
#include "define.h"
#include "goalscore.h"
#include "robomove.h"
#include "roboturn.h"
#include "led.h"
#include "bumper.h"
#include "distance.h"
#include "init.h"
#include "skunk.h"
#include "strategy.h"
#include "robotest.h"
#include "fantasy.h"
#include "monitor.h"

int usetup(void) {
	irdist_set_calibration (SHARP_M, SHARP_C);
	
	openSkunk();
	servo_set_pos(SERVO_SCORE, 240);
	
	check_stuck = 0; // for Stuck Handler
	getGoalScore();
	caliUnderLed();
	caliLeftLed();
	caliRightLed();

	return 0;
}

int umain (void) {
	fantasy();
	printf("\nSTART!");

	gameMonitor();

	initPose();
	printf_P (PSTR("\nPlace %d, orient %d"), initPlace, initOrient);
	initTurn();
	
	state = 1;
	myStrategy();

	return 0;
}
